Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use correct variable name #2135

Merged

Conversation

knoxell
Copy link
Contributor

@knoxell knoxell commented Feb 17, 2023

Description

  • [ x ] Source branch in your fork has meaningful name (not main)

Fixes Issue:

beautify_file of cssbeautifier (python module) not working because usage of two different variable names file and file_name.

See __init__.py:

...
def beautify_file(file_name, opts=None):
    _main = __import__("cssbeautifier", globals(), locals(), ["_main"])._main
    return _main.beautify_file(file, opts)
...

results in:

# file.py
import cssbeautifier

cssbeautifier.beautify_file('./file.css')
$ python file.py         
Traceback (most recent call last):
  File ".../file.py", line 3, in <module>
    x = cssbeautifier.beautify_file('./file.css')
  File ".../cssbeautifier/__init__.py", line 41, in beautify_file
    return _main.beautify_file(file, opts)
NameError: name 'file' is not defined. Did you mean: 'filter'?

Before Merge Checklist

These items can be completed after PR is created.

(Check any items that are not applicable (NA) for this PR)

  • [ x ] JavaScript implementation
  • Python implementation (NA if HTML beautifier)
  • [ x ] Added Tests to data file(s)
  • [ x ] Added command-line option(s) (NA if
  • [ x ] README.md documents new feature/option(s)

@bitwiseman bitwiseman merged commit 7922cbe into beautifier:main Apr 22, 2023
@bitwiseman bitwiseman added this to the v1.14.8 (next release) milestone Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants